#include <stdio.h>
#include <string.h>

int main()
{
    char str[1001];
    while(gets(str)){    //或scanf("%[^\n]",str);
        int len = strlen(str);
        int abcs = 0, nums = 0, spaces = 0, others = 0;
        
        for(int i = 0; i < len;i++){
            if (str[i] <= 'z' && str[i] >= 'a' ||\
                str[i] <= 'Z' && str[i] >= 'A'){
                abcs++;   //字母数量
            }
            if(str[i] == ' '){
                spaces++;  //空格数量
            }
            if(str[i] >= '0' && str[i] <= '9'){
                nums++;    //数字数量
            }
        }
        others = len - abcs - spaces - nums;   //其他数量
        printf("%d\n%d\n%d\n%d\n",abcs, spaces, nums, others);
    }
    return 0;
}
